<@app.html>
    <@app.head>
    </@app.head>
    <@app.body>
        <@app.container>
            <@app.banner/>
        <div class="main">
            <@app.menu/>
            <div class="content">
                <div class="panel grid_wrap" style="top: 10px;">
                    <form method="post">
                        <div class="settings_body">
                            <fieldset>
                                <legend>电池押金</legend>
                                <div class="ui_table">
                                    <table id="page_table" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td width="100" align="right">金额：</td>
                                            <td><input type="text" class="text easyui-numberspinner" id="money"
                                                       style="width:130px; height: 28px;"
                                                       data-options="min:0, precision:2"
                                                       value="${batteryForegift.money/100}" required="required"/>&nbsp;元
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </fieldset>
                        </div>
                    </form>
                    <div class="settings_btn">
                        <@app.has_oper oper_code='3_16_2'>
                            <button class="btn btn_red ok">保 存</button>
                        </@app.has_oper>
                        <button class="btn btn_border close">重 置</button>
                    </div>
                </div>
            </div>
        </div>
        </@app.container>
    </@app.body>
</@app.html>
<script>
    (function () {
        var form = $('form');

        $('button.ok').click(function () {
            form.form('submit', {
                url: '${contextPath}/security/hdw/battery_foregift/update.htm',
                onSubmit: function (param) {
                    var money = $('#money').numberspinner('getValue');
                    param.money = parseInt(Math.round(money * 100));
                    console.log(money)
                    return true;
                },
                success: function (text) {
                    var json = $.evalJSON(text);
                <@app.json_jump/>
                    if (json.success) {
                        $.messager.alert('提示信息', '操作成功', 'info');
                        document.location.href = '${contextPath}/security/hdw/battery_foregift/index.htm'
                    } else {
                        $.messager.alert('提示信息', json.message, 'info');
                    }
                }
            });
        });

        $('button.close').click(function () {
            document.location.href = '${contextPath}/security/hdw/battery_foregift/index.htm'
        });

    })()
</script>

